<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>借阅管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function getinfo(rdid) {
			window.open('${ctx}/book/borrowed/readerborrowlist?rdId='+rdid, 'selected', 'directorys=no,toolbar=no,status=no,menubar=no,resizable=no,width=750,height=500,top=150,left=200,scrollbars=yes');
		}
        function exportExcel() {
            $("#searchForm").attr("action", "${ctx}/book/borrowed/exportExcel").submit();
        }
        function searchLog() {
            $("#searchForm").attr("action", "${ctx}/book/borrowed/current").submit();
        }
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
<form:form id="searchForm" modelAttribute="borrowLog" action="${ctx}/book/borrowed/current" method="post" class="breadcrumb form-search ">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
	<ul class="ul-form">
		<li><label>借书证号：</label>
			<form:input path="rdCardNo" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
		<li><label>借书日期：</label>
            <input id="startTime" name="startTime"  type="text" readonly="readonly" class="input-medium Wdate" style="width:130px;"
                   value="${borrowLog.startTime}"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd', maxDate:'#F{$dp.$D(\'endTime\')}'});"/>
                --
            <input id="endTime" name="endTime"  type="text" readonly="readonly" class="input-medium Wdate" style="width:130px;"
                   value="${borrowLog.endTime}"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd', minDate:'#F{$dp.$D(\'startTime\')}'});"/>
		</li>
		<li class="btns">
            <a id="btnSubmit" onclick="searchLog()" class="btn">查询</a>
            <a id="btnExport" onclick="exportExcel()" class="btn">导出Excel</a>
        </li>
	</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th>流水编号</th>
		<th>操作类别</th>
		<th>借书证号</th>
		<th>读者姓名</th>
		<th>图书种类</th>
		<th>书籍编号</th>
		<th>书籍名称</th>
		<th>操作时间</th>
		<th>操作人员</th>
		<th>借出记录</th>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="loglist">
		<tr>
			<td>${loglist.logId}</td>
			<td>${fns:getDictLabel(loglist.doType, 'do_type', '借出')}</td>
			<td>${loglist.rdCardNo}</td>
			<td>${loglist.rdName}</td>
			<td>${loglist.bkType}</td>
			<td>${loglist.banId}</td>
			<td>${loglist.bkName}</td>
			<td>${loglist.doTime}</td>
			<td>
				<c:if test="${loglist.doType == '0' && loglist.source == 'self'}">
					自助借阅
				</c:if>
                <c:if test="${loglist.doType == '1' && loglist.source == 'self'}">
                    自助归还
                </c:if>
				<c:if test="${loglist.doType == '2' && loglist.source == 'self'}">
					自助续借
				</c:if>
				<c:if test="${loglist.source != 'self'}">
					${loglist.operator}
				</c:if>
			</td>
			<td>${loglist.zlId}</td>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>